<?php 
$Gallery = $this->Gallery;

if(  User::getRole() == "user"   ) { ?>
<div style="float: right;padding: 5px 10px;"><a href="<?php echo $this->baseUrl('gallery/edit/id/' . $Gallery['id'])?>">Редактировать страницу</a></div>
<?php }
?>
			
<p class="titlebig"><?=$Gallery['Name'] ?></p>

<table border="0" cellpadding="0" cellspacing="0">
<tbody><tr>
	
	
	<?php 
	$i = 0;
foreach ($Gallery['pictures'] as $File)
{
    $i++;
?>
	<td class="photo" valign="top">
	<!-- Start of photo -->
	<table border="0" cellpadding="0" cellspacing="0">
	<tbody><tr>
		<td colspan="3"><img src="/theme/images/ph_bordtop1.jpg" height="11" width="210"></td>
	</tr>
	<tr>
		<td class="bgphbl"><img src="/theme/images/spacer.gif" height="1" width="11"></td>
		<td><a href="/images/thumb_big/<?=$File['filename']?>" title="<?=$File['Title']?>" class="fancybox" rel="fancybox"><img src="/images/thumb_small/<?=$File['filename']?>" alt="<?=$File['Title']?>" ></a></td>
		<td class="bgphbr"><img src="/theme/images/spacer.gif" height="1" width="11"></td>
	</tr>
		<tr>
			<td colspan="3"><img src="/theme/images/ph_bordbot1.jpg" height="12" width="210"></td>
		</tr>
	</tbody></table>
	<?=$File['Title']?>
	</td>
	
	<?php 
	if ( ($i % 3) == 0 )
	{?>
	<tr>
	<td colspan="5" align="center"><img src="/theme/images/line.gif" height="55" width="548"></td>
</tr>
	<?
	}
	else
	{?>
	
	<td><img src="/theme/images/spacer.gif" height="1" width="10"></td>
	
	<?php 
	}    
	?>
	
<?php 
}


	if ( ($i % 3) !== 0 )
	{
?>
	
<tr>
	<td colspan="5" align="center"><img src="/theme/images/line.gif" height="55" width="548"></td>
</tr>
<?php 
	}
	?>
<!--<tr>
	<td colspan="5" class="reg2" align="center">1 | <a href="#">2</a> | <a href="#">3</a></td>
</tr>
--></tbody></table>

<script>
$(document).ready(function() {

	
	$(".fancybox").fancybox({
		'transitionIn'	:	'elastic',
		'transitionOut'	:	'elastic',
		'speedIn'		:	600, 
		'speedOut'		:	200, 
		'overlayShow'	:	true
	});
	
});
</script>



